package sk.tuke.constraintbuilder.editor;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

import sk.tuke.constraintbuilder.model.RootElement;
import sk.tuke.constraintbuilder.model.TopElement;

public class EditorInput implements IEditorInput {
	
    private final RootElement inputElement;
    
    public EditorInput(RootElement element) {
        this.inputElement = element;
    }
    
    @Override
    public boolean exists() {
        return true;
    }

    @Override
    public ImageDescriptor getImageDescriptor() {
        return null;
    }

    @Override
    public String getName() {
        return inputElement.getName();
    }

    @Override
    public IPersistableElement getPersistable() {
        return null;
    }

    @Override
    public String getToolTipText() {
        return "Displays a constraint";
    }

    @Override
    public Object getAdapter(Class adapter) {
        return null;
    }

    @Override
    public int hashCode() {
        return inputElement.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if(inputElement.equals(obj)) return true;
        else return false;
    }

	public RootElement getInputElement() {
		return inputElement;
	}
   

}